package com.holly.controller;

import com.holly.pojo.ClazzOption;
import com.holly.pojo.JobOption;
import com.holly.pojo.Result;
import com.holly.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author holly
 * @create 2025-07-02 20:48
 */
@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;

    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        log.info("获取员工职位数据");
        JobOption empJobData = reportService.getEmpJobData();
        return Result.success(empJobData);
    }

    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        log.info("获取员工性别数据");
        List<Map> empGenderData = reportService.getEmpGenderData();
        return Result.success(empGenderData);
    }

    @GetMapping("/studentCountData")
    public Result getStudentCountData(){
        log.info("统计每一个班级的人数");
        ClazzOption studentCountData = reportService.getStudentCountData();
        return Result.success(studentCountData);
    }

    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        log.info("统计学员的学历数据");
        List<Map> studentDegreeData = reportService.getStudentDegreeData();
        return Result.success(studentDegreeData);
    }



}
